---@class Battle.BuffEffect5:Battle.BuffEffectBase
---属性增减buff脚本
local BuffEffect5 = Battle.CreateClass("BuffEffect5",Battle.BuffEffectBase)
Battle.BuffEffect5 = BuffEffect5
function BuffEffect5:OnCreate(buff)
    ---@type Battle.Buffer
    self.buff = buff
    local param = decodeJsonStrToTable(self.buff.cfg.f_EffectParameter )
    self.damage = param[1][1]/10000
    self.isActive = false
    self.actor = Battle.ActorManager.GetActor(self.buff.targetId)
    self.actor.eventSystem:Register(Battle.Event.ActorDamageBefore,self.DamageBefore,self)
end
function BuffEffect5:OnBuffStart()
    self.isActive = true
end
---@param args Battle.HitArgs
function BuffEffect5:DamageBefore(args)
    if not self.isActive then return end
    args.damageData.damage = args.damageData.damage * (1+self.damage)
    self.isActive = false
end
function BuffEffect5:OnDestroy()
    self.actor.eventSystem:UnRegister(Battle.Event.ActorDamageBefore,self.DamageBefore,self)
end

return BuffEffect5